﻿@model HanGu.Entity.MemberInfo
@{
    ViewBag.Title = "我的汉古";
    Layout = "~/Views/Shared/Main.cshtml";
    TempData["sidecalss"] = "EveryDayWisdom";

    TempData["TitlePic"] = Model.PicPath.Replace("_B.", "_S.");
    TempData["ContorlID"] = "Introduction";
    TempData["Remark"] = Model.Introduction;
    TempData["GropName"] = Model.GUID;
    var SexList = ViewData["SexList"] as SelectList;
    var IsMarryList = ViewData["IsMarry"] as SelectList;
    var ProviceList = ViewData["Provice"] as SelectList;
    var CityList = ViewData["City"] as SelectList;
    var NativePlaceList = ViewData["NativePlace"] as SelectList;
    var JobList = ViewData["Job"] as SelectList;
    var TradeList = ViewData["Trade"] as SelectList;
    var InterestList = ViewData["Interest"] as SelectList;
    List<string> InterestArry = new List<string>();
    if (Model.Interest != null)
    { InterestArry.AddRange(Model.Interest.Split(',')); }
    var MemberGrade = ViewData["MemberGrade"] as SelectList;
    var Degree = ViewData["Degree"] as SelectList;


}
@section Header
{
    <style>
        .contentLeft
        {
            width: 100%;
        }
        #partContent
        {
            width: 100%;
        }
        .movieContain
        {
            width: 100%;
            margin-top: 5px;
        }
    </style>
}
@section Banner
{
    @Html.Partial("Banner")
}
@section Content{
    <div class="contentLeft">
        <table cellpadding="0" cellspacing="0" id="partContent" style="height: 100%;">
            <tr>
                <td>
                    <div class="ContentTitle">
                        <div class="ContentTitleLeft">
                            <img src="/Content/images/vipmyhanguTitle.gif" width="145" height="26" alt=""></div>
                        <div class="ContentTitleRight">
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="content">
                    <div class="contentLeft" style="height: 550px; width: 150px; background-color: #ccc">
                        @Html.Partial("vipLeftMenu")
                    </div>
                    <div class="contentLeft MyInfo" style="height: 100%; width: 500px; margin-left: 20px;">
                        <p>
                            <label>
                                真实姓名：</label>
                            @Model.RealName
                        </p>
                        <p>
                            <label>
                                学位：</label>
                            @{
                                var modelDegree = Degree.SingleOrDefault(c => c.Value == Model.Degree);
                                if (modelDegree != null)
                                {
                                @modelDegree.Text
                                }                                  }
                        </p>
                        <p>
                            <label>
                                级别：</label>
                            @{
                                var modelGrade = MemberGrade.SingleOrDefault(c => c.Value == Model.Grade);
                                if (modelGrade != null)
                                { 
                                @modelGrade.Text;
                                }
                            }
                        </p>
                        @* <p>
                            <label>
                                账号：</label>
                            @Model.UserName
                        </p>*@
                        <p>
                            <label>
                                性别：</label>
                            @{
                                var sexModel = SexList.SingleOrDefault(c => c.Value == Model.Sex);
                                if (sexModel != null)
                                {
                                @sexModel.Text
                                }
                            }
                        </p>
                        <p>
                            <label>
                                婚姻状况：</label>
                            @{
                                var marryModel = IsMarryList.SingleOrDefault(c => c.Value == Model.IsMarry);
                                if (marryModel != null)
                                {
                                @marryModel.Text
                                }
                            }
                        </p>
                        <p>
                            <label>
                                手机：</label>
                            @Model.Tel
                        </p>
                        <p>
                            <label>
                                邮箱：</label>
                            @Model.Email
                        </p>
                        <p>
                            <label>
                                证件号码：</label>
                            @Model.CredentialNum
                        </p>
                        <p>
                            <label>
                                所在城市：</label>
                            @{
                                var modelProvice = ProviceList.SingleOrDefault(c => c.Value == Model.Provice);
                                if (modelProvice != null)
                                {
                                @modelProvice.Text
                                }
                                
                            }
                            &nbsp;&nbsp;
                            @{
                                var modelCity = CityList.SingleOrDefault(c => c.Value == Model.City);
                                if (modelCity != null)
                                {
                                @modelCity.Text
                                }
                            }
                        </p>
                        <p>
                            <label>
                                通讯地址：</label>
                            @Model.Address
                        </p>
                        <p>
                            <label>
                                邮编：</label>
                            @Model.Zip
                        </p>
                        <p>
                            <label>
                                籍贯：</label>
                            @{
                                var modelNativePlace = NativePlaceList.SingleOrDefault(c => c.Value == Model.NativePlace);
                                if (modelNativePlace != null)
                                {
                                @modelNativePlace.Text
                                }
                            }
                        </p>
                        <p style="width: 500px">
                            <label>
                                职业：</label>
                            @if (!string.IsNullOrEmpty(Model.Job))
                            {
                                @Model.JobOther
                            }
                            else
                            {

                                var jobModel = JobList.SingleOrDefault(c => c.Value == Model.Job);
                                if (jobModel != null)
                                {
                                @jobModel.Text;
                                }
                            }
                        </p>
                        <p>
                            <label>
                                工作单位：</label>
                            @Model.WorkAddress
                        </p>
                        <p style="width: 500px">
                            <label>
                                所属行业：</label>
                            @if (!string.IsNullOrEmpty(Model.TradeOther))
                            {
                                @Model.TradeOther
                            }
                            else
                            {
                                var tradeModel = TradeList.SingleOrDefault(c => c.Value == Model.Trade);
                                if (tradeModel != null)
                                {
                                @tradeModel.Text
                                }
                            }
                        </p>
                        <p>
                            <label>
                                职位：</label>
                            @Model.Position
                        </p>
                        <p>
                            <label>
                                兴趣点：</label>
                            @foreach (var item in InterestList)
                            {
                                if (InterestArry.Contains(item.Value))
                                {
                                @item.Text
                                }
                            }
                        </p>
                        <p style="width: 100%;">
                            <label>
                                简介：</label>
                            @Model.Introduction
                        </p>
                    </div>
                </td>
            </tr>
        </table>
    </div>
}
@section Side{
    @Html.Partial("Side")
}
<script>
    function getValidateCode() {
        $.ajax({
            type: "POST",
            url: "/vip/login",
            data: "User=" + User + "&Pwd=" + Pwd + "&code=" + code,
            success: function (data) {
                var json = eval("(" + data + ")");
                if (json.statusCode == 200) {
                    window.location = '@Url.Action("index", "vip")';
                }
                else {
                    alert(json.message);
                }
            }
        });

    }
    $(function () { $("#registerForm").validate(); });
</script>
